/*tid.c*/
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>

void *t1_exe(void *arg){
    printf("In new created thread\n");
    printf("My pid is %d and my pthread is %d\n",getpid(),(unsigned int)pthread_self());
}

void main() {
    pthread_t pid1;
    int error1;
    error1=pthread_create(&pid1,NULL, t1_exe,NULL);
    if (error1!=0) {
        printf("pthread_create failed ");
        return ;
    }
    printf("In main process\n");
    printf("My pid is %d and my pthread is %d\n",getpid(),(unsigned int)pthread_self());
    pthread_join(pid1,NULL);
    return ;
}

